<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/views/include/taglib.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<title>的关注</title>
	<%@ include file="/views/include/nocachehead.jsp"%>
</head>

<body>
	<%@ include file="/views/include/statusbar.jsp"%><br/><br/><br/><br/>
	<div>
		<div class="tab-all">
			<c:if test="${empty requestScope.type}">全部关注</c:if>
			<c:if test="${not empty requestScope.type}">
				<a href="${pageContext.request.contextPath}/follow/${requestScope.ownerId }.html">全部关注</a>
			</c:if>
		</div>
		<div class="tab-user">
			<c:if test="${requestScope.type eq 'USER'}">关注用户</c:if>
			<c:if test="${requestScope.type ne 'USER'}">
				<a href="${pageContext.request.contextPath}/follow/${requestScope.ownerId }.html?type=USER">关注用户</a>
			</c:if>
		</div>
		<div class="tab-attraction">
			<c:if test="${requestScope.type eq 'ATTRACTION'}">关注景点</c:if>
			<c:if test="${requestScope.type ne 'ATTRACTION'}">
				<a href="${pageContext.request.contextPath}/follow/${requestScope.ownerId }.html?type=ATTRACTION">关注景点</a>
			</c:if>
		</div>
	</div>
	<c:set var="redirectUrl" value="${pageContext.request.contextPath}/follow/${requestScope.ownerId }.html?curpage=${requestScope.page.curpage }%26type=${requestScope.type }"/>
	<div>
		<c:forEach items="${requestScope.idolList }" var="idol">
			<div>
				<c:if test="${idol.idolType eq 'USER' }">
					<div>
						<a href="${pageContext.request.contextPath}/wo/${idol.idolId}.html">
							<img alt="${idol.idolNickname}"	src="${pageContext.request.contextPath}/image/${idol.idolPortrait}" />
						</a>
					</div>
					<div>
						<p>
							<a href="${pageContext.request.contextPath}/wo/${idol.idolId}.html">
								<skyline:summary length="10" value="${idol.idolNickname }"/>
							</a>
						</p>
						<p>
							<c:if test="${idol.followed and idol.idolId ne requestScope.viewerId}">
								<a class="followed">已关注</a>
							</c:if>
							<c:if test="${not idol.followed and idol.idolId ne requestScope.viewerId}">
								<c:if test="${logined }">
									<a href="#" onclick="Follow.follow('${idol.idolId }','${idol.idolNickname }','${idol.idolPortrait }','USER',this,followedOk,'${redirectUrl }');">关注TA</a>
								</c:if>
								<c:if test="${not logined }">
									<a href="${pageContext.request.contextPath}/login.html?requestFrom=${redirectUrl }">关注TA</a>
								</c:if>
							</c:if>
						</p>
					</div>
				</c:if>
				<c:if test="${idol.idolType eq 'ATTRACTION' }">
					<div>
						<a href="${pageContext.request.contextPath}/attraction/view/${idol.idolId}.html">
							<img alt="${idol.idolNickname}"	src="${pageContext.request.contextPath}/image/${idol.idolPortrait}" />
						</a>
					</div>
					<div>
						<p>
							<a href="${pageContext.request.contextPath}/attraction/view/${idol.idolId}.html">
								<skyline:summary length="10" value="${idol.idolNickname }"/>
							</a>
						</p>
						<p>
							<c:if test="${idol.followed and idol.idolId ne requestScope.viewerId}">
								<a class="followed">已关注</a>
							</c:if>
							<c:if test="${not idol.followed and idol.idolId ne requestScope.viewerId}">
								<c:if test="${logined }">
									<a href="#" onclick="Follow.follow('${idol.idolId }','${idol.idolNickname }','${idol.idolPortrait }','ATTRACTION',this,followedOk,'${redirectUrl }');">关注景点</a>
								</c:if>
								<c:if test="${not logined }">
									<a href="${pageContext.request.contextPath}/login.html?requestFrom=${redirectUrl }">关注景点</a>
								</c:if>
							</c:if>
						</p>
					</div>
				</c:if>
			</div>
		</c:forEach>
	</div>
	<div>
		<skyline:page url="${pageContext.request.contextPath}/follow/${requestScope.ownerId}.html?type=${requestScope.type }"
			page="${requestScope.page}" maxSize="6" />
	</div>
	
	<script type="text/javascript">
		function followedOk(input) {
			$(input).html("已关注").addClass("followed").removeAttr("onclick").removeAttr("href");
		}
	</script>
</body>
</html>